<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
function test(){//同步

}

function test(){//异步
return new Promise()
}
//async写在函数前表示函数内部有异步操作，返回promise对象
async function demo(){
    return new Promise((resolve,reject)=>{
        resolve('hello world')
    })
}

async function demo2() {//实现异步函数
    return"hello world"
    
}

console.log(demo2())
    </script>
    
</body>
</html>